import request from '@/config/axios'

export interface YearStageVO {
  id: number
  beginYear: number
  beginDate: Date
  endDate: Date
  status: number
  stageNumber: number
  semester: number
}

// 查询教学阶段计划分页
export const getYearStagePage = async (data) => {
  return await request.post({ url: `/cmis/year-stage/page`, data })
}
// 查询教学阶段计划列表
export const getYearStageList = async (data) => {
  return await request.post({ url: `/cmis/year-stage/query`, data })
}

// 查询教学阶段计划详情
export const getYearStage = async (id: number) => {
  return await request.get({ url: `/cmis/year-stage/get?id=` + id })
}

// 新增教学阶段计划
export const createYearStage = async (data: YearStageVO) => {
  return await request.post({ url: `/cmis/year-stage/create`, data })
}

// 修改教学阶段计划
export const updateYearStage = async (data: YearStageVO) => {
  return await request.put({ url: `/cmis/year-stage/update`, data })
}

// 删除教学阶段计划
export const deleteYearStage = async (id: number) => {
  return await request.delete({ url: `/cmis/year-stage/delete?id=` + id })
}

// 导出教学阶段计划 Excel
export const exportYearStage = async (params) => {
  return await request.download({ url: `/cmis/year-stage/export-excel`, params })
}

// 下载教学阶段计划 Excel模版
export const importTemplate = async () => {
  return await request.download({ url: `/cmis/year-stage/get-import-template` })
}

// 导入教学阶段计划 Excel
export const importYearStage = async (data) => {
  return await request.upload({ url: `/cmis/year-stage/import-excel`, data: data })
}
